Ext.define('Emp.view.user.Edit', {
	extend: 'Emp.view.BaseEdit',
	alias: 'widget.useredit',
	
	requires: [
		'Emp.ux.form.field.ComboTree',
		'Emp.store.Status'
	],

	width: 300,
	height: 200,
	
	initComponent: function() {
		var me = this;
		me.items = [{
			xtype: 'form',
			border: false,
			bodyPadding: 5,
			layout: 'anchor',
			defaults: {
				labelAlign: 'right',
				labelWidth: 50,
				anchor: '90%'
			},
			defaultType: 'textfield',
			items: [{
					fieldLabel: 'id',
					name: 'id',
					hidden: true
				}, {
					fieldLabel: '用户名',
					name: 'userName',
					allowBlank: false
				}, {
					fieldLabel: '账号',
					name: 'loginName',
					allowBlank: false
				}, {
					xtype: 'combotree',
					fieldLabel: '部门',
					name: 'deptId',
					treeConfig: {
						useArrows: true,
						rootVisible: false
					},
					displayField: 'cnName',
					valueField: 'id',
					store: Ext.create('Emp.store.DeptNode', {
						proxy: {
							type: 'ajax',
							url: PATH + '/dept/stree'
						}
					}),
					forceSelection: true,
					allowBlank: false
				}, {
					fieldLabel: '状态',
		            name: 'status',
		            xtype: 'combobox',
					store: Ext.create('Emp.store.Status'),
					queryMode: 'local',
					displayField: 'display',
					valueField: 'value',
					forceSelection: true,
					allowBlank: false
				}, {
					fieldLabel: '排序',
					name: 'sort',
					xtype: 'numberfield',
					hideTrigger: true,
					allowDecimals:false,
					allowBlank: false
			}]
		}];
		me.callParent();
	}
});